package inc.gome.dynamic.datasource.netty;


import io.netty.channel.socket.nio.NioSocketChannel;

import java.util.Arrays;


/*客户端连接server端的  连接池*/
class ClientPool{
    NioSocketChannel[] clients;
    Object[] lock;

    ClientPool(int size){
        clients = new NioSocketChannel[size];//init  连接都是空的
        lock = new Object[size]; //锁是可以初始化的
        for(int i = 0;i< size;i++){
            lock[i] = new Object();
        }

    }

    @Override
    public String toString() {
        return "ClientPool{" +
                "clients=" + Arrays.toString(clients) +
                '}';
    }
}